export default function (req, res) {
    const { body } = req;
  
    // Validate required request body parameters
    if (!body.orderId) {
      return {
        code: 1,
        message: '缺少必需参数：orderId'
      };
    }
  
    if (!body.reasonTypes || body.reasonTypes.length === 0) {
      return {
        code: 1,
        message: '缺少必需参数：reasonTypes'
      };
    }
  
    // Simulate a successful refund creation
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          message: '退费申请成功！',
          data: Math.floor(Math.random() * 100000) + 1, // Return a mock refund ID
          timestamp: Date.now(),
          requestId: 'requestId_' + Math.random().toString(36).substring(2, 15),
          signature: 'signature_' + Math.random().toString(36).substring(2, 15),
        });
      }, 100);
    });
  }